#ifndef MANAGEMENTDATABASEOPERATIONS_H
#define MANAGEMENTDATABASEOPERATIONS_H

#include <QMessageBox>
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlQuery>

extern bool connectManagementDB(QString dbName);

extern bool initManagementDB();

extern bool insertProject(int projectID, QString projectName, 
                                      QString projectCreateDateTime, QString projectLastChangeDateTime);

extern bool insertProduct(int productID, QString name, QString manufacturers, QString orderNum, 
               QString mediumType, QString appProgram, QString version, QString deviceDBName);

extern bool deleteProduct(int productID);

extern bool deleteProject(int projectID);

extern bool updateProjectName(int projectID, QString projectName);

extern bool updateProjectLastChangeDateTime(int projectID, QString lastChangeDateTime);

extern bool updateProjectFlagByID(int projectID, int flagValue);

extern int selectNextProjectID();

extern int selectNextProductID();

extern bool selectOneProjectInfo(int projectID);

extern int selectProjectIDByFlag(int falgValue);

extern int isProductNameExistsInDM(QString productName);

#endif // MANAGEMENTDATABASEOPERATIONS_H
